﻿/*
 * uart.h
 *
 * Created: 2018/12/25 星期二 0:27:04
 *  Author: Administrator
 */ 


#ifndef UART_H_
#define UART_H_

#define FRAMING_ERROR (1<<FE0)//
#define PARITY_ERROR (1<<UPE0)//
#define DATA_OVERRUN (1<<DOR0)//
#define DATA_REGISTER_EMPTY (1<<UDRE0)//
#define RX_COMPLETE (1<<RXC0)//

#define USART_BAUD 38400
#define TX_BUFFER_SIZE 50
#define RX_BUFFER_SIZE 50

#define RX_FRAME_HEAD 0xAA
#define RX_FRAME_SIZE 20
#define RX_COMMAND_SPEED 0x01


extern unsigned char rx_command[RX_FRAME_SIZE];

void Init_USART(void);
void my_print(unsigned char *pbuff);
void my_print_hex(unsigned int num);
void my_print_dec(unsigned int num);
void my_print_tab(void);

unsigned char usart_scan(void);



#endif /* UART_H_ */
